package top.onedream.buildsmallsoftware.service

import top.onedream.buildsmallsoftware.model.user.User

interface UserService {

    /**
     * 获取当前用户
     * @param [id] id
     * @return [List<User>]
     */
    fun getCurrentUser(id: Long?, page: Int, size: Int, desc: Boolean): List<User?>

    /**
     * 让用户通过用户名和年龄
     * @param [username] 用户名
     * @param [age] 年龄
     * @return [User?]
     */
    fun getUserByUsernameAndAge(username: String?, age: Int?): List<User>

    /**
     * 保存用户
     * @param [user] 用户
     * @return [String?]
     */
    fun saveAUser(user: User): Long

    /**
     * 获取用户用户名
     * @param [username] 用户名
     * @return [User?]
     */
    fun getUserByUsername(username: String): User?

    /**
     * 更新用户角色
     * @param [roleId] 角色id
     * @param [roleName] 角色名
     * @param [userId] 用户id
     * @return [String?]
     */
    fun updateUserRole(roleId: Long?, roleName: String?, userId: Long): Long?

}